
import React from 'react';
import { decorator } from 'grey-react-box';
import { RouteChildrenProps, withRouter } from 'react-router-dom';
import { useUrlParameter } from 'router/utils';
import UserInfo from 'central/UserInfo';

export default decorator<any, RouteChildrenProps>(withRouter)(props => {

    const [code] = useUrlParameter('code');

    const [state] = useUrlParameter('state');

    React.useEffect(() => {
        UserInfo.instance.signIn({ code, redirect: state });
    }, [code, state])

    return (
        <div>正在登陆...</div>
    )
})